package com.lwb.ztx.news.presenter;

import com.lwb.ztx.bean.NewsTopicBean;
import com.lwb.ztx.news.model.NewsTopicModel;
import com.lwb.ztx.news.model.NewsTopicModelImpl;
import com.lwb.ztx.news.view.NewsTopicView;

import java.util.List;

/**
 * Created by Administrator on 2016/5/29.
 */
public class NewsTopicPresenterImpl implements NewsTopicPresenter,NewsTopicModelImpl.OnNewsTopicLoadFinishListener {
    private NewsTopicView newsTopicView;
    private NewsTopicModel newsTopicModel;

    public NewsTopicPresenterImpl(NewsTopicView newsTopicView) {
        this.newsTopicView = newsTopicView;
        newsTopicModel = new NewsTopicModelImpl(this);
    }

    @Override
    public void getTopicBeans(String url) {
        newsTopicModel.loadTopicBean(url);
    }

    @Override
    public void onSuccess(List<NewsTopicBean> beans) {
        newsTopicView.setTopic(beans);
    }

    @Override
    public void onFailure() {

    }
}
